package com.gitee.order.controller;


import com.gitee.order.feign.ProductFeignService;
import com.gitee.order.feign.StockFeignService;
import com.gitee.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    private StockFeignService stockFeignService;
    @Autowired
    private ProductFeignService productFeignService;

    @Autowired
    private OrderService orderService;

    @RequestMapping("create")
    public String createOrder(@RequestParam("sno") String sno, @RequestParam("productId") Long productId, Integer count) {
        orderService.createOrder(sno, productId, count);

        return "Hello Feign";
    }
}
